




#include "mex.h"
#include "miniTV.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{

  
  
  //
  float *x_recon, *x0;
  int width,height;
  float lamda;
  
  
  x0=(float*)mxGetData(prhs[0]);
  
  width=(int)mxGetScalar(mxGetField(prhs[1],0,"nx"));
  height =(int)mxGetScalar(mxGetField(prhs[1],0,"ny"));
  
  lamda = (float)mxGetScalar(prhs[2]);
  
  int iterNum = (int)mxGetScalar(prhs[3]);

  plhs[0]=mxCreateNumericMatrix(width*height,1,mxSINGLE_CLASS,0);
  x_recon=(float*)mxGetData(plhs[0]);

  
  
  //
 miniTV_gpu(x_recon,x0,width, height,lamda,iterNum);
  //mexPrintf("t=%f\n",t);

}